home *** CD-ROM | disk | FTP | other *** search
/ Garbo / Garbo.cdr / mac / hypercrd / hc2_x / tcprogud.sit / TC Prog Guide / card_33614.txt < prev    next >
Text File  |  1991-02-27  |  1KB  |  24 lines

  1. -- card: 33614 from stack: in
  2. -- bmap block id: 0
  3. -- flags: 0000
  4. -- background id: 4755
  5. -- name: 
  6.  
  7.  
  8. -- part contents for background part 6
  9. ----- text -----
  10. 8.1  I/O Functions
  11.  
  12. -- part contents for background part 7
  13. ----- text -----
  14. 188
  15.  
  16. -- part contents for background part 4
  17. ----- text -----
  18. TC's standard I/O (input/output) FUNCTIONS are contained in the ANSI library.  The standard header file stdio.h contains declarations for these functions; i.e., any source file which uses standard I/O functions should contain the preprocessor directive:
  19.  
  20.     # include   <stdio.h>
  21.  
  22. In practice, professional TC programs often call the Macintosh Toolbox routines (via the MacTraps specialized library) directly to accomplish the user interface rather than use the standard I/O library.  This technique produces efficient but non-portable programs which take full advantage of the Macintosh's graphical capabilities.  Nonetheless, the standard I/O functions are useful for producing portable programs where a command-line user interface is tolerated.
  23.  
  24. The standard ANSI I/O functions treat input and output as "streams" of bytes or characters, which are written to and read from binary or text files or I/O devices.  The procedure for addressing such a file or device is:  first "open" the stream; perform I/O; then "close" the stream.